package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	//for i := 0; i < 10000; i++ {
	//	slice := []int{1, 2, 3, 4, 5, 6}
	//	for i := range slice {
	//		j := nrandom.Int(0, i+1)
	//		slice[i], slice[j] = slice[j], slice[i]
	//	}
	//	//fmt.Printf("%+v\n", slice)
	//}

	slice := []int{1, 2, 3, 4, 5, 6}
	rand.Seed(time.Now().UnixNano())
	rand.Shuffle(len(slice), func(i, j int) {
		slice[i], slice[j] = slice[j], slice[i]
	})
	fmt.Printf("%+v\n", slice)

	//hitCount := map[int]int{}
	//for i := 0; i < 10000; i++ {
	//	hit := nrandom.Int(0, 10)
	//	hitCount[hit] += 1
	//}
	//
	//fmt.Printf("hit count=%+v\n", hitCount)
}
